home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Bill's Win32Asm Page / registers1.txt < prev    next >
Encoding:
Text File  |  2000-05-25  |  3.4 KB  |  89 lines

  1. Introduction to Registers
  2. By Bill T.
  3. May 10, 1998
  4.  
  5.  
  6. Introduction
  7. -----------------------------------------------------------------------------
  8.  
  9. Registers are located directly on the CPU.  They are used to store data for
  10. processing.  The general registers can be used to store anything needed, but
  11. some registers are specialized for certain functions.
  12.  
  13.  
  14. Registers
  15. -----------------------------------------------------------------------------
  16.  
  17. General Purpose Registers:
  18.   EAX  Accumulator:   Used for general purpose and slightly specialized for
  19.                       mathematical results
  20.   EBX  Base:          Used for general purpose and specialized for indexing
  21.   ECX  Counter:       Used for general purpose and specialized for counting
  22.   EDX  Data:          General purpose register
  23.  
  24.   Each of these registers are 32-bit. They each can be divided into a 16-bit
  25.   register: AX, BX, CX, DX.  They can also be furthur divided into two 8-bit
  26.   registers, AH (high) and AL (low).
  27.   EAX is 32-bit, therefore it is 4 bytes, called a DWORD.
  28.   AX is 16-bit, 2 bytes, called a WORD.
  29.   AL and AH are each 8-bit or 1 BYTE.
  30.  
  31. Offset Registers:
  32.   EBP  Base Pointer:        General purpose, holding offsets, and indexing
  33.   ESP  Stack Pointer:       Points to the top of the stack
  34.                             The next item pushed on the stack goes here
  35.   ESI  Source Index:        Used for general purpose as well as the source in
  36.                             data movement operations
  37.   EDI  Destination Index:   Used for general purpose as well as the destination
  38.                             in data movement operations
  39.   EIP  Instruction Pointer: Points to the instruction to be executed next
  40.  
  41.   Each of these registers asre 32-bit, but can also be accessed as a 16-bit
  42.   register (BP, SP, SI, DI, IP).
  43.  
  44. Segment Registers:
  45.   CS  Code Segment:  Segment containing the code of the current program
  46.   DS  Data Segment:  Segment containing the data of current program
  47.   ES  Extra Segment: Function depends upon program, may be unused
  48.   FS  Extra Segment:
  49.   GS  Extra Segment:
  50.   SS  Stack Segment: Segment which contains the stack memory
  51.  
  52.   These registers are each 16-bit.  Each locate the start of a 64K segment in
  53.   memory.  You cannot perform math on segment registers or use them to hold the
  54.   results of other operations.  Segments may be stored anywhere in memory.
  55.  
  56. Flags Register:
  57.   o  Overflow Flag
  58.   d  Direction Flag
  59.   i  Interrupt Enable Flag
  60.   t  Trap Flag
  61.   s  Sign Flag
  62.   z  Zero Flag
  63.   a  Auxillary Flag
  64.   p  Parity Flag
  65.   c  Carry Flag
  66.  
  67.   The flags usually represent the result of various instructions. In addition
  68.   to those listed there are several other flags which are not frequently used.
  69.  
  70. Other Registers:
  71.   CR0-CR3  Control Registers
  72.            These 32-bit registers handle things such as processor mode,
  73.            paging and so on.
  74.   DR0-DR7  Debug Registers
  75.            These are 32-bit registers which are used for debugging
  76.            purposes. DR0-DR3 are used to hold breakpoint addresses and
  77.            DR4-DR7 determine the results of a breakpoint.
  78.   TR6-TR7  Test Registers
  79.            These 32-bit registers are used to test memory paging.
  80.   IDTR     Interrupt Descriptor Table Register (52-bit)
  81.   GDTR     Global Descriptor Table Register (52-bit)
  82.   LDTR     Local Descriptor Table Register (68-bit)
  83.   TR       Task State Segment Register (68-bit)
  84.  
  85.  
  86. -----------------------------------------------------------------------------
  87.  
  88. Copyright (C) 1998
  89. Bill T.  (billasm@usa.net)